import Heap from '../maxHeap'
// import Heap from '../index'
import Assert from '@/utils/assets'

export const test = () => {
    const h = new Heap<number>([1, 2, 3, 4, 5, 6, 9, 20, 21, 23, 30, 41, 44, 50, 55, 56, 71]);
    // const h = new Heap<number>([1, 2, 3, 4, 5, 6, 9, 20, 21, 23, 30, 41, 44, 50, 55, 56, 71].reverse());
    const assert = new Assert();
    print(h)
    h.heapify();
    print(h)

}

/**
 * 打印堆
 * @param h 
 */
const print = (h: Heap) => {
    let str = ''
    h.forEach((ele, i) => {
        str += ele + ' '
    })
    console.log(str)
}